/**
 * Created by user on 2018/3/20.
 */
import { LoginType } from '../actions/loginAction'
const login_state = {
  loading: false,
  error: '',
  value: ''
}
const LoginState = (state = login_state, action) => {
  switch (action.type) {
    case LoginType.change_input:
      return Object.assign({}, state, {
        value: action.value
      })
    case LoginType.change_error:
      return Object.assign({}, state, {
        error: action.error
      })
    case LoginType.change_loading:
      return Object.assign({}, state, {
        loading: action.loading
      })
    default:
      return state
  }
}
LoginState._default_state = login_state
export default LoginState
